Safety: require 100% branch coverage - #3736
Closed
joedlai wants to merge 3 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #3742 to submit this work from khchen428. The code and commits are unchanged. Please continue review on the replacement PR.
The safety suite has 157 uncovered branches with GCC, and the CI gate only requires line coverage. Add regressions for partial wheel/brake/pedal signals, cruise and button transitions, malformed actuation and diagnostic payloads, variant isolation, and common safety configuration failures. Remove dispatch checks already implied by the active RX/TX descriptors and simplify exhaustive callbacks, then require 100% line and branch coverage.
Safety behavior is intended to remain unchanged. Configuration-dependent guards that are reachable, including Nissan's alternate cruise bus and Hyundai powertrain selection, remain and gain tests. The existing test-harness exclusion and mutation survivor list are unchanged.
Ignoring indentation, the production changes are 57 added and 143 removed lines across 23 headers; most of the larger header diffs come from removing an outer dispatch check and unindenting its body.
Validation:
Related to #2557. I recognize the existing reservation and competing #3702. This implementation is independent; #3702's description also suggested paired-library validation, which is credited in the local validation harness. The comparison covers tested input traces and current descriptor assumptions, not every possible safety behavior.
The separate replay reporting workflow timed out while waiting for the artifact; the replay job completed successfully with the result above. GitHub refused the requested rerun.